home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / csystray.000 / csystray / csystray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-22  |  1.5 KB  |  55 lines

  1. // csystray.h : Header file for the CWin95SystemTray class.
  2. //
  3.  
  4. #ifndef __CSYSTRAY_H__
  5. #define __CSYSTRAY_H__
  6.  
  7. #include <shellapi.h>
  8.  
  9. class CWin95SystemTray : public CObject
  10. {
  11. public:
  12.     // ***** PUBLIC DATA
  13.  
  14.     // ***** PUBLIC FUNCTIONS
  15.     CWin95SystemTray(HWND hWnd = 0, UINT uCallbackMsgID = 0);
  16.     virtual ~CWin95SystemTray();
  17.  
  18. // Attributes
  19.     // Attach the callback window.
  20.     BOOL    Attach(HWND hWnd);
  21.     HWND    Detach(HWND hWnd = 0);
  22.  
  23.     // By default, the destructor removes the item.
  24.     void    EnableAutoUnregister(BOOL bEnable = TRUE);
  25.  
  26.     // Windows 95 will sent notification messages to hWnd using this message ID.
  27.     void    RegisterCallbackMessage(UINT uMsgID);
  28.  
  29. // Operations
  30.     BOOL    ItemAdd(UINT uID);  // Adds an item to the system tray.
  31.     BOOL    ItemDelete(UINT uID);  // Removes an item from the system tray. 
  32.     BOOL    ItemModify(UINT uID,  // Associates an icon and or bubble text to uID.
  33.                 HICON hIcon,
  34.                 LPCSTR pszBubbleText = NULL);
  35.     BOOL    ItemSetBubbleText(UINT uID,  // A shortcut of ItemModify just for text.
  36.                 LPCSTR pszBubbleText);
  37.  
  38.  
  39.  
  40. protected:
  41.     // ***** PROTECTED DATA
  42.     NOTIFYICONDATA  m_NotifyIconData;
  43.     DWORD           m_dwFlags;
  44.     
  45.     // ***** PROTECTED FUNCTIONS
  46.     void    Init(void);
  47.     BOOL    SystemTrayMessage(HWND hWnd,
  48.                 DWORD dwMessage,
  49.                 UINT uID,
  50.                 HICON hIcon = NULL,
  51.                 LPCSTR pszBubbleText = NULL);
  52. };
  53.  
  54. #endif  // __CSYSTRAY_H__
  55.